package com.bluenave.crm.core.domain;

import javax.persistence.*;
import java.io.Serializable;
import java.security.Security;

/**
 * Created by IntelliJ IDEA.
 * User: aleksanderbrancewicz
 * Date: 7/26/11
 * Time: 6:32 PM
 * To change this template use File | Settings | File Templates.
 */

@Entity
@DiscriminatorValue("1")
public class PersonContact extends Contact implements Serializable{

    private Person person = null;

    public PersonContact() {
        super();
    }

    public PersonContact(Person person, String email,boolean active, String phoneNumber){
        super(email,active,phoneNumber);
        this.person = person;
    }

    @OneToOne(fetch = FetchType.LAZY,cascade = {CascadeType.REMOVE, CascadeType.REFRESH})
    public Person getPerson() {
        return person;
    }

    public void setPerson(Person person) {
        this.person = person;
    }
}
